//
//  ChooseProsecutorCell.m
//  KuWoCan
//
//  Created by hwd on 17/3/17.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "ChooseProsecutorCell.h"

static ChooseProsecutorCell *selectCell = nil;

@implementation ChooseProsecutorCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI
{
    __weak typeof(self) weakSelf = self;
    _addressLab = [UILabel new];
    _addressLab.text = @"address";
    _addressLab.font = KwFont(14);
    _addressLab.textColor = [UIColor grayColor];
    [self addSubview:_addressLab];
    [_addressLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(weakSelf.mas_centerX);
        make.top.equalTo(@15);
        make.height.equalTo(@14);
    }];
    
    _nameLab = [UILabel new];
    _nameLab.text = @"name";
    _nameLab.font = KwFont(14);
    _nameLab.textColor = [UIColor grayColor];
    [self addSubview:_nameLab];
    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(_addressLab.mas_left).offset(-10);
        make.top.equalTo(_addressLab.mas_top);
        make.height.equalTo(_addressLab.mas_height);
        make.bottom.equalTo(@-15);
    }];
    
    _imgView = [UIImageView new];
    _imgView.image = kImg(@"yuan");
    [self addSubview:_imgView];
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_addressLab.mas_right).offset(20);
        make.size.mas_equalTo(CGSizeMake(20, 20));
        make.centerY.equalTo(_addressLab.mas_centerY);
    }];
}

- (void)setSelected:(BOOL)selected
{
    if (selected == YES)
    {
        self.addressLab.textColor = KwBlueColor;
        self.nameLab.textColor = KwBlueColor;
        self.imgView.image = kImg(@"yuan_sel");
    }
    else
    {
        self.addressLab.textColor = [UIColor grayColor];
        self.nameLab.textColor = [UIColor grayColor];
        self.imgView.image = kImg(@"yuan");
    }
}


@end
